package com.tanhua.server.controller;

import com.tanhua.model.vo.UserInfoVo;
import com.tanhua.server.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * 用户详情管理控制层
 */
@Slf4j
@RestController
@RequestMapping("/users")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     *  用户资料 - 读取
     *  Query: 地址带了一个参数
     *  userID ==> Long userID
     */
    @RequestMapping(method = RequestMethod.GET)
    public ResponseEntity findUserInfo(Long userID){
        log.debug("************进去了********************");
        UserInfoVo userInfoVo = userInfoService.findUserInfo(userID);
        log.debug("************出去了********************");
        return ResponseEntity.ok(userInfoVo);
    }

}
